<template>
  <el-input-number v-if="props.itemType === 'number'"></el-input-number>
  <el-cascader v-else-if="props.itemType === 'cascader'"></el-cascader>
  <el-switch v-else-if="props.itemType === 'switch'"></el-switch>
  <el-time-picker v-else-if="props.itemType === 'time-picker'"></el-time-picker>
  <el-time-select v-else-if="props.itemType === 'time-select'"></el-time-select>
  <el-checkbox v-else-if="props.itemType === 'checkbox'"></el-checkbox>
  <el-radio-group v-else-if="props.itemType === 'radio-group'"></el-radio-group>
  <el-rate v-else-if="props.itemType === 'rate'"></el-rate>
  <el-date-picker v-else-if="props.itemType === 'date-picker'"></el-date-picker>
  <el-select v-else-if="props.itemType === 'select' && props.options">
    <el-option
      v-for="item in options"
      :key="item.value"
      :label="item.label"
      :value="item.value"
    ></el-option>
  </el-select>
  <el-input v-else></el-input>
</template>
<script lang="ts" setup name="T_FormItem">
import { itemTypeStr, optionsList } from '@/interfaces/Element/Form'
interface FormItemType {
  itemType?: itemTypeStr
  options?: optionsList
}
const props = withDefaults(defineProps<FormItemType>(), {})
</script>
<style lang="scss"></style>
